/*
 * @Description:所有静态数据
 * @Author: your name
 * @version:
 * @Date: 2023-12-18 15:25:23
 * @LastEditors: your name
 * @LastEditTime: 2023-12-26 14:31:47
 */
import { getCommunityOpts, getPeopleChartOpts, getDataViewer, getEventOpts } from './echartOpts.js'
import * as echarts from 'echarts'
import myThreeDPipe from './threeDemensionPipe.js'
export const headerData = [
  {
    title: "项目总数",
    value: 722,
    icon: "/src/assets/bigscreenAssets/icon.png",
  },
  {
    title: "已建项目",
    value: 732,
    icon: "/src/assets/bigscreenAssets/icon2.png",
  },
  {
    title: "在建项目",
    value: 222,
    icon: "/src/assets/bigscreenAssets/icon3.png",
  },
  {
    title: "建筑总数",
    value: 72322,
    icon: "/src/assets/bigscreenAssets/icon4.png",
  },
  {
    title: "居民楼总数",
    value: 31232,
    icon: "/src/assets/bigscreenAssets/icon5.png",
  },
  {
    title: "人口总数",
    value: 1032,
    icon: "/src/assets/bigscreenAssets/icon6.png",
  },
];

export const warningData = () => {
  const data = [];
  for (let i = 0; i < 100; i++) {
    data.push({
      告警类型: "正常",
      报警区域: "长春路",
      报警时间: "2023-03-04",
      报警内容: "停水停电",
    });
  }
  return data;
};

export const initEchart = () => {
  const myChartPipe3D = echarts.init(document.getElementById("pipeChart3D")); // 3d饼图
  const myChartCommunity = echarts.init(
    document.getElementById("communityChart")
  ); // 社区投诉chart
  const myChartPeople = echarts.init(document.getElementById("peopleChart")); // 社区投诉chart
  const myChartDataViewer = echarts.init(document.getElementById("dataViewer")); // 数据总览chart
  const myChartEvent = echarts.init(document.getElementById("eventStatstic")); // 事件统计chart
  // mock数据 设施情况
  const dataS = [
    {
      name: "一类设备",
      value: 360,
      itemStyle: {
        color: "#1890FF65",
      },
    },
    {
      name: "二类设备",
      value: 320,
      itemStyle: {
        color: "#1EE7E765",
      },
    },
    {
      name: "三类设备",
      value: 332,
      itemStyle: {
        color: "#F3F62B65",
      },
    },
  ];

  // mock数据社区投诉排名
  const dataC = [
    {
      value: "8209",
      name: "开发区",
    },
    {
      value: "7544",
      name: "经开区",
    },
    {
      value: "5412",
      name: "居民区",
    },
    {
      value: "3909",
      name: "商业区",
    },
    {
      value: "1234",
      name: "工业区",
    },
  ];

  // mock数据-人口趋势
  const dataP = [
    {
      name: "2016年",
      value: 1000,
    },
    {
      name: "2017年",
      value: 1005,
    },
    {
      name: "2018年",
      value: 1015,
    },
    {
      name: "2019年",
      value: 1105,
    },
    {
      name: "2020年",
      value: 1115,
    },
    {
      name: "2021年",
      value: 1205,
    },
    {
      name: "20220年",
      value: 1225,
    },
  ];
  myThreeDPipe(myChartPipe3D, 2000, dataS, 0.6);
  const communityOpts = getCommunityOpts(dataC);
  myChartCommunity.setOption(communityOpts);
  const peopleOpts = getPeopleChartOpts(dataP);
  myChartPeople.setOption(peopleOpts);
  const dataViewer = getDataViewer();
  myChartDataViewer.setOption(dataViewer);
  const eventOpts = getEventOpts();
  myChartEvent.setOption(eventOpts);
};

export const menus=[
    {
        title:'场景配置',
        path:'/scene_manage',
        isActive:false,
        iconName:'icon-shezhi'
    },{
        title:'首页',
        path:'/wholeScene',
        isActive:false,
        iconName:'icon-shouye'
    },{
        title:'可视化功能',
        path:'/dispatch',
        isActive:false,
        iconName:'icon-tiaodu'
    }
]
